package servlet.servlet_yaobo;

import pojo.HarvestAddress;
import service.impl.ImpShoppingMemberService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 用于获取指定的地址数据
 */
@WebServlet(value = "/address")
public class addressServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HarvestAddress me=new HarvestAddress();
        ImpShoppingMemberService imp=new ImpShoppingMemberService();
        String ids=req.getParameter("u_id");
        me=imp.addressModify(Integer.parseInt(ids));
        req.setAttribute("me",me);
        req.getRequestDispatcher("shouHuo.jsp").forward(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
